@echo off

set UE=E:\Next\UnrealEngine

rmdir /S /Q build_temp
rmdir /S /Q lib\Linux

mkdir build_temp
mkdir lib\Linux

cd build_temp
cmake -DUE=%UE% -DCMAKE_CXX_STANDARD=17 -DCMAKE_CXX_EXTENSIONS=OFF -DBUILD_WITH_LIBCXX=ON -DBUILD_SHARED_LIBS=OFF -Dprotobuf_BUILD_TESTS=OFF -Dprotobuf_BUILD_CONFORMANCE=OFF -Dprotobuf_DISABLE_RTTI=ON -Dprotobuf_BUILD_EXAMPLES=OFF -Dprotobuf_BUILD_PROTOC_BINARIES=OFF -DARCHITECTURE_TRIPLE=x86_64-unknown-linux-gnu -DCMAKE_TOOLCHAIN_FILE=..\toolchains\linux.toolchain.cmake -DCMAKE_MAKE_PROGRAM=%UE%/Engine/Extras/ThirdPartyNotUE/GNU_Make/make-3.81/bin/make.exe -DZLIB_LIBRARY=%UE%\Engine\Source\ThirdParty\zlib\1.3\lib\Unix\x86_64-unknown-linux-gnu\Release\libz.a -DZLIB_INCLUDE_DIR=%UE%\Engine\Source\ThirdParty\zlib\1.3\include -G "Unix Makefiles" ..\source
cd ..
cmake --build build_temp --config Release -v
move build_temp\libprotobuf.a lib\Linux
